#include "CFGConfig.h"
using namespace xml_api;

CCFGConfig& CCFGConfig::Instance()
{
  static CCFGConfig instance;
  return instance;
}

CCFGConfig::CCFGConfig()
{

}

bool CCFGConfig::SaveState(Memento* m)
{
  return true;
}

bool CCFGConfig::LoadState(Memento* m)
{
  int child_num=m->GetChildCount();
  for(int i=0; i<child_num; ++i)
  {
    Memento* child_m=m->GetChild(i);
    std::string child_name = child_m->GetName();
    if("Counter" == child_name)
    {
      m_counter.LoadState(child_m);
    }
    else if("DataBaseSetting" == child_name)
    {
      m_dataBaseSetting.LoadState(child_m);
    }
    else if("CTPDownData" == child_name)
    {
      m_ctpDownData.LoadState(child_m);
    }
  }

  return true;
}